POV-Ray : Newsgroups : povray.general : Help with a spherical container : Re: Help with a spherical container Server Time
4 Nov 2024 17:30:23 EST (-0500)
  Re: Help with a spherical container  
From: Warp
Date: 4 Nov 2003 20:22:08
Message: <3fa850c0@news.povray.org>
Wesley Parker <wes### [at] verizonnet> wrote:
> Hey, i had an idea for something pretty interesting but I am having problems
> implementing it.  What i did was create a sphere with object media at the
> origin with a radius of five. That part was easy enough, but placing the
> lights is troubling me. I need the placement to be random, but at the same
> time the lights need to be on the inside of the sphere.

#declare Seed = seed(0);

#declare LightLocation = 10*<rand(Seed), rand(Seed), rand(Seed)>-5;
#while(vlength(LightLocation) > 5)
  #declare LightLocation = 10*<rand(Seed), rand(Seed), rand(Seed)>-5;
#end

  After the loop ends you will have a random point inside the sphere
of radius 5 in 'LightLocation'.

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.